import React from "react";
import styles from "./withHead.module.less";
import Message from "./index";
import defaultHead from "@images/sex0.webp";

const WithHead = (props) => {
    const { item } = props;

    return (
        <div className={styles.with_head}>
            <div className={styles.head}>
                <div className={styles.head_img}>
                    <img
                        src={
                            item
                                ? require(`@images/head//${item.avatarUrl}`)
                                : defaultHead
                        }
                        alt=""
                    />
                </div>
                <p className={styles.head_name}>
                    {item ? item.userName : "--"}
                </p>
            </div>
            <Message item={item} />
        </div>
    );
};

export default WithHead;
